const { SuccessModel, ErrorModel } = require('../../model/responseMode');
const { addMusiclrc, addMusiclrcText, updataMusiclrcText} = require('../../controllers/music/musiclrcCotroller');

const musicLrcRouter = async (req, res) => {
  const { method, url } = req;
  const path = url.split('?')[0];

  // 上传歌词列表
  if(path == '/api/add/musiclrc/list'){
    let data = await addMusiclrc();
    return new SuccessModel(data);
  }

  // 上传歌词文件
  if(path == '/api/add/musiclrc'){
    let data = await addMusiclrcText();
    return new SuccessModel(data);
  }

  // 更新歌词键
  if(path == '/api/updata/musiclrc'){
    let data = await updataMusiclrcText();
    return new SuccessModel(data);
  }
}

module.exports = musicLrcRouter;